// packageI/knowledge/components/list/list.js
let itemOption = {
  article_name: 'article_name',
  creater_name: 'creater_name',
  base_name: 'base_name',
  created_at: 'created_at'
};
Component({
  /**
   * 组件的属性列表
   */
  properties: {
    list: {
      type: Array,
      value: ()=>[]
    },
    itemOption: {
      type: Object,
      value: itemOption
    },
    plu: {
      type: String,
      value: null
    }
  },

  /**
   * 组件的初始数据
   */
  data: {},

  /**
   * 组件的方法列表
   */
  methods: {
    linkto(e) {
      let item = e.currentTarget.dataset.item;
      this.triggerEvent('click', item)
      // let {id,base_id,knowledge_base_id} = e.currentTarget.dataset.item;
      // let _base_id = base_id||knowledge_base_id;
      // wx.navigateTo({
      //   url: `/packageI\knowledge\knowledgeDetail\knowledgeDetail?id=${id}&bid=${base_id}&plu=${}`
      // })
    },
    toBaseMenu(e) {
      let {knowledge_base_id} = e.currentTarget.dataset.item;
      if(!knowledge_base_id||!this.data.plu) return;
      wx.navigateTo({
        url: `/packageI/knowledge/knowledgeList/knowledgeList?bid=${knowledge_base_id}&plu=${this.data.plu}`
      })
    },
  }
})
